﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SPVisualDev.VSAddin.Dialogs
{
    public partial class DialogInputBox : Form
    {
        public DialogInputBox()
        {
            InitializeComponent();

            this.KeyPress += new KeyPressEventHandler(DialogInputBox_KeyPress);
        }

        void DialogInputBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == '\n' || e.KeyChar == '\r')
            {
                this.DialogResult = DialogResult.OK;
                this.Hide();
            }
        }


        public string InfoMessage
        {
            get { return lblInfo.Text;  }
            set { lblInfo.Text = value; }
        }

        public string InputText
        {
            get { return txtInput.Text; }
            set { txtInput.Text = value; }
        }

        public string DialogTitle
        {
            get { return this.Text; }
            set { this.Text = value; }
        }
    }
}
